# Copyright 2008-2009 Markus Dittrich <markusle@gentoo.org>
# Distributed under the terms of the GNU General Public License v3
#

VERSION=0.3
DESTDIR=
mandir=$(DESTDIR)/usr/share/man/man1
docdir=$(DESTDIR)/usr/share/doc/hark-$(VERSION)
htmldir=$(docdir)/html
bindir=$(DESTDIR)/usr/bin

GHC_FLAGS_DEVEL = -O -Wall -fwarn-simple-patterns -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-monomorphism-restriction -fwarn-implicit-prelude -fno-warn-orphans

GHC_FLAGS_RELEASE = -O2
export GHC_FLAGS_RELEASE GHC_FLAGS_DEVEL


all: devel


release:
	$(MAKE) -C src release


devel:
	$(MAKE) -C src devel



doc:
	$(MAKE) -C src doc


install:
	install -d $(docdir)
	install -d $(mandir)
	install -d $(bindir)
	install -d $(htmldir)
	install -m 0755 src/hark $(bindir)/
	install -m 0644 AUTHORS $(docdir)/
	install -m 0644 html/* $(htmldir)/
	install -m 0644 man/hark.1 $(mandir)/
	

.PHONY: test clean

test: 
	$(MAKE) -C test

clean:
	$(MAKE) -C test clean
	$(MAKE) -C src clean
